package ooday03;

public class AnimalTest {
    public static void main(String[] args) {
        Dog dog = new Dog("金金",2,"金");
        System.out.println(dog.name);







        /*
        Dog[] dogs = new Dog[3];
        dogs[0] = new Dog("小黑",2,"黑色");
        dogs[1] = new Dog("小白",2,"白色");
        dogs[2] = new Dog("小红",2,"红色");
        System.out.println(dogs[0].name); //输出第1只狗狗的名字
        dogs[1].age = 4; //修改第2只狗狗年龄为4岁
        dogs[2].swim(); //第3只狗狗在游泳
        for (int i = 0; i<dogs.length; i++){
            System.out.println(dogs[i].name);
            dogs[i].eat();
        }


        Chick[] chicks = new Chick[2];
        chicks[0] = new Chick("灰灰",3,"灰");
        chicks[1] = new Chick("黄黄",2,"黄");
        chicks[1].color = "蓝";
        for (int i = 0; i < chicks.length; i++) {
            System.out.println(chicks[i].color);
            chicks[i].layEggs();
        }


        Fish[] fish = new Fish[3];
        fish[0] = new Fish("晶晶",1,"金");
        fish[1] = new Fish("黑黑",1,"黑");
        fish[2] = new Fish("红红",1,"红");
        fish[2].name = "大红";
        for (int i = 0; i < fish.length; i++) {
            System.out.println(fish[i].name);
            fish[i].swim();
        }

         */
    }

    public static int getInt(){
        return 3;
    }
}
